<template>
  <div>
    <ToolBarComponent ref="queryForm">
      <QueryBarComponent row-num="1">
        <InputComponent input-lable="属性名" input-name="paramName" input-type="text"></InputComponent>
        <InputComponent input-lable="属性码" input-name="paramCode" input-type="text"></InputComponent>
        <Button text="查询" :click-function="queryBtnClick"></Button>
      </QueryBarComponent>
    </ToolBarComponent>
    <ToolBarComponent>
      <Button text="重置" :click-function="resetSysParam"></Button>
    </ToolBarComponent>
    <GridComponent ref="queryGrid"
        load-url="sysParam/queryParamCode.do"
        :paging-moduel="true"
        select-moduel="single"
        :auto-load="true"
        grid-name="sequeuceGrid"
        key-property-name="id"
        max-height-prop="75%"
    >
      <GridColumnComponent index-name="paramName" column-name="属性名" width="300px"></GridColumnComponent>
      <GridColumnComponent index-name="paramCode" column-name="属性码" width="300px"></GridColumnComponent>
      <GridColumnComponent index-name="paramDescrip" column-name="参数描述" width="500px"></GridColumnComponent>
      <GridColumnComponent index-name="paramValue" column-name="参数值" width="150px" :data-render="sysParamRender"></GridColumnComponent>
    </GridComponent>
    <DictGroupComponent ref="dict">
      <DictDefineComponent dict-group="G0001"/>
    </DictGroupComponent>
  </div>
</template>

<script>
import ToolBarComponent from "@/components/toolbar/ToolBarComponent";
import QueryBarComponent from "@/components/toolbar/QueryBarComponent";
import InputComponent from "@/components/input/InputComponent";
import GridComponent from "@/components/grid/GridComponent";
import GridColumnComponent from "@/components/grid/GridColumnComponent";
import Button from "@/components/button/ButtonComponent";
import {translateByDict} from "@/common-util";
import DictGroupComponent from "@/components/dict/DictGroupComponent";
import DictDefineComponent from "@/components/dict/DictDefineComponent";

export default {
  name: "SysParamQuery",
  components: {
    DictDefineComponent,
    DictGroupComponent,
    Button, GridColumnComponent, GridComponent, InputComponent, QueryBarComponent, ToolBarComponent},
  data(){
    return{
      pagingModuel:true
    }
  },
  methods:{
    queryBtnClick:function (){
      let queryParam = this.$refs["queryForm"].getSubmitParams();
      this.$refs["queryGrid"].addQueryParams(queryParam);
      this.$refs["queryGrid"].load();
    },
    resetSysParam:function (){
      /*let key = this.$refs["queryGrid"].getSelectKeys();
      postRequest(
          "manage/sequeuce/reset.do",
          {sequeuceName:sequeuceName},
          this.queryBtnClick,
          this.queryBtnClick,
          this
      );*/
    },
    sysParamRender(columnData){
      return translateByDict(columnData,this.$refs["dict"].getDictGroup("G0001"));
    }
  }
}
</script>

<style scoped>

</style>